﻿<?php
     function getParameter($pname){
          return isset($_POST[$pname])?$_POST[$pname]:"";
     }

     $transurl = "http://maple2.neweb.com.tw/CashSystemFrontEnd/Payment";
     $code = "abcd1234";
     $merchantnumber = getParameter('merchantnumber');
     $ordernumber = getParameter('ordernumber');
     $amount = getParameter('amount');
     $paymenttype = getParameter('paymenttype');
     $paytitle = getParameter('paytitle');
     $paymemo = getParameter('paymemo');
     $bankid = getParameter('bankid');

	$duedate = getParameter('duedate');
	$payname = getParameter('payname');
	$payphone = getParameter('payphone');
     $returnvalue = (getParameter('returnvalue')=="1");
     $reprint = (getParameter('reprint')=="1");
     $hash = md5($merchantnumber.$code.$amount.$ordernumber);
     $nexturl = getParameter('nexturl');
?>
<html>
<head>
<script>
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>簡單付購物流程範例-確認付款</title>
</head>
<body>
<!--form method="POST" action="http://maple2.neweb.com.tw/CashSystemFrontEnd/Payment"-->
<form method="POST" action="<?php echo $transurl ?>">
<center>
<table border=1 cellpadding=0 cellspacing=0 bordercolor="#dddddd" width="45%">
     <tr>
          <td>商家編號</td>
          <td><input type="hidden" name="merchantnumber" value="<?php echo $merchantnumber ?>"><?php echo $merchantnumber ?></td>
     </tr>
     <tr>
          <td>訂單編號</td>
          <td><input type="hidden" name="ordernumber" value="<?php echo $ordernumber ?>"><?php echo $ordernumber ?></td>
     </tr>
     <tr>
          <td>金額</td>
          <td><input type="hidden" name="amount" value="<?php echo $amount ?>"><?php echo $amount ?></td>
     </tr>
     <tr>
          <td>付款方式</td>
          <td><input type="hidden" name="paymenttype" value="<?php echo $paymenttype ?>"><?php echo $paymenttype ?></td>
     </tr>
     <tr>
          <td>銀行代號</td>
          <td><input type="hidden" name="bankid" value="<?php echo $bankid ?>"><?php echo $bankid ?></td>
     </tr>
     <tr>
          <td>付款說明</td>
          <td><input type="hidden" name="paytitle" value="<?php echo $paytitle ?>"><?php echo $paytitle ?></td>
     </tr>
     <tr>
          <td>備註</td>
          <td><input type="hidden" name="paymemo" value="<?php echo $paymemo ?>"><?php echo $paymemo ?></td>
     </tr>  
     <tr>
          <td>繳款人姓名</td>
          <td><input type="hidden" name="payname" value="<?php echo $payname ?>"><?php echo $payname ?></td>
     </tr>
     <tr>
          <td>繳款人電話</td>
          <td><input type="hidden" name="payphone" value="<?php echo $payphone ?>"><?php echo $payphone ?></td>
     </tr>
     <tr>
          <td>繳費期限</td>
          <td><input type="hidden" name="duedate" value="<?php echo $duedate ?>"><?php echo $duedate ?></td>
     </tr>
     <tr>
          <td>直接回傳值</td>
          <td><input type="hidden" name="returnvalue" value="<?php echo ($returnvalue?"1":"0") ?>"><?php echo ($returnvalue?"是":"否") ?></td>
     </tr>
     <tr>
          <td colspan=2>
               <input type="hidden" name="hash" value="<?php echo $hash ?>">
               <input type="hidden" name="nexturl" value="http://商家網址">
               <input type="submit" value=" 送 出 ">
          </td>
     </tr>
</table>
</center>
</form>
</body>
</html>
